{include file="public/header" /}
<div class="page">
        <form id="zhu_form" method="post" name="form1">
            <input type="hidden" name="zhuwork_id" value="{$zhuwork_array.zhuwork_id}" id="zhuwork_id"/>
            <input type="hidden" name="id" value="{$zhuwork_array.zhuwork_id}" id="id"/>
            <table class="ds-default-table">
                <tbody>
                <tr class="noborder">
                    <td class="required w120"><label class="validation">{$Think.lang.zhuwork_index_name}:</label></td>
                    <td class="vatop rowform"><input type="text" value="{$zhuwork_array.zhuwork_name}" name="zhuwork_name" id="zhuwork_name" class="txt"></td>
                    <td class="vatop tips"></td>
                </tr>
                <tr class="noborder">
                    <td class="required w120"><label class="validation">{$Think.lang.zhuwork_index_account}:</label></td>
                    <td class="vatop rowform"><input readonly type="text" value="{$zhuwork_array.zhuwork_account}" name="zhuwork_account" id="zhuwork_account" class="txt"></td>
                    <td class="vatop tips"></td>
                </tr>
                <tr class="noborder">
                    <td class="required w120"><label class="validation">{$Think.lang.zhuwork_index_password}:</label></td>
                    <td class="vatop rowform"><input type="password" value="" name="zhuwork_password" id="zhuwork_password" class="txt"></td>
                    <td class="vatop tips">{if $zhuwork_array.zhuwork_id}{$Think.lang.zhuwork_index_password_tip}{/if}</td>
                </tr>
                <tr class="noborder">
                    <td class="required w120"><label class="validation">{$Think.lang.zhuwork_queren_password}:</label></td>
                    <td class="vatop rowform"><input type="password" value="" name="zhuwork_queren_password" id="zhuwork_queren_password" class="txt"></td>
                    <td class="vatop tips">{if $zhuwork_array.zhuwork_id}{$Think.lang.zhuwork_index_password_tip}{/if}</td>
                </tr>
                <tr class="noborder">
                    <td class="required w120"><label class="validation">{$Think.lang.zhuwork_index_truename}:</label></td>
                    <td class="vatop rowform"><input type="text" value="{$zhuwork_array.truename}" name="truename" id="truename" class="txt"></td>
                    <td class="vatop tips"></td>
                </tr>
                <tr class="noborder">
                    <td class="required w120"><label class="validation">{$Think.lang.zhuwork_index_idcard}:</label></td>
                    <td class="vatop rowform"><input type="text" value="{$zhuwork_array.idcard}" name="idcard" id="idcard" class="txt"></td>
                    <td class="vatop tips"></td>
                </tr>
                <tr class="noborder">
                    <td class="required w120"><label class="validation">{$Think.lang.zhuwork_index_sex}:</label></td>
                    <td class="vatop rowform">
                        <input type="radio" value="0" name="sex" {if $zhuwork_array.sex == 0}checked {/if}>{$Think.lang.zhuwork_index_sex_0}&nbsp;&nbsp;&nbsp;&nbsp;
                        <input type="radio" value="1" name="sex" {if $zhuwork_array.sex == 1}checked {/if}>{$Think.lang.zhuwork_index_sex_1}&nbsp;&nbsp;&nbsp;&nbsp;
                        <input type="radio" value="2" name="sex" {if $zhuwork_array.sex == 2}checked {/if}>{$Think.lang.zhuwork_index_sex_2}&nbsp;&nbsp;&nbsp;&nbsp;
                    </td>
                    <td class="vatop tips"></td>
                </tr>
                <tr class="noborder">
                    <td class="required w120"><label>{$Think.lang.zhuwork_index_status}: </label></td>
                    <td class="vatop rowform onoff">
                        <label for="zhuwork_status1" class="cb-enable {if $zhuwork_array.zhuwork_status == '1'}selected{/if}" title="{$Think.lang.zhuwork_index_status_on}"><span>{$Think.lang.zhuwork_index_status_on}</span></label>
                        <label for="zhuwork_status0" class="cb-disable {if $zhuwork_array.zhuwork_status == '0'}selected{/if}" title="{$Think.lang.zhuwork_index_status_off}"><span>{$Think.lang.zhuwork_index_status_off}</span></label>
                        <input id="zhuwork_status1" name="zhuwork_status" {if $zhuwork_array.zhuwork_status == '1'}checked="checked"{/if} value="1" type="radio">
                        <input id="zhuwork_status0" name="zhuwork_status" {if $zhuwork_array.zhuwork_status == '0'}checked="checked"{/if} value="0" type="radio">
                    </td>
                    <td  class="vatop tips">{$Think.lang.zhuwork_index_status_tip}</td>
                </tr>
                <tr class="noborder">
                    <td class="required w120">{$Think.lang.zhuwork_index_gid}</td>
                    <td class="vatop rowform">
                        <select name="zhuwork_gid">
                            {foreach name="gadmin" item="v"}2
                            <option value="{$v.gid}" {if $zhuwork_array["zhuwork_gid"] == $v.gid} selected{/if}>{$v.gname}</option>
                            {/foreach}
                        </select>
                    </td>
                    <td class="vatop tips"></td>
                </tr>
                </tbody>
                <tfoot>
                <tr class="tfoot">
                    <td colspan="15" ><input class="btn" type="submit" value="{$Think.lang.ds_submit}"/></td>
                </tr>
                </tfoot>
            </table>
        </form>
    </div>
<script src="{$Think.PLUGINS_SITE_ROOT}/mlselection.js"></script>
<script>
//按钮先执行验证再提交表
    $(document).ready(function () {
        $("#zhu_form").validate({
            errorPlacement: function (error,element) {
                error.appendTo(element.parent().parent().find('td:last'));
            },
            rules:{
                zhuwork_name:{
                    required:true,
                    minlength:4,
                    maxlength:8,
                    remote:{
                        url:ADMINSITEURL+'/Zhuwork/ajax.html?branch=check_zhuwork_name',
                        type:'get',
                        data:{
                            zhuwork_name:function () {
                             return $('#zhuwork_name').val();
                            },
                            zhuwork_id:function () {
                                return $('#zhuwork_id').val();
                            }
                        }
                    }
                },
                zhuwork_account:{
                    required:true,
                    minlength:6,
                    // maxlength:8,
                    remote:{
                        url: ADMINSITEURL+'/Zhuwork/ajax.html?branch=check_zhuwork_account',
                        type:'get',
                        data:{
                            zhuwork_account:function () {
                                return $('#zhuwork_account').val();
                            },
                            zhuwork_id:function () {
                                return $('#zhuwork_id').val();
                            }
                        }
                    }
                },
                zhuwork_password:{
                    // required:true,
                    minlength:6,
                    // maxlength:8,
                },
                zhuwork_queren_password:{
                    // required:true,
                    equalTo:"#zhuwork_password",
                },
                truename:{
                    required:true,
                    minlength:2,
                },
                idcard:{
                    required:true,
                    remote:{
                        url:ADMINSITEURL+'/Zhuwork/ajax_idcard.html',
                        type:'get',
                        data:{
                            idcard:function () {
                                return $('#idcard').val();
                            },
                        }
                    }
                },
            },
            messages:{
                zhuwork_name:{
                    required:'{$Think.lang.zhuwork_index_name_validate}',
                    minlength:'{$Think.lang.zhuwork_index_name_validate_max}',
                    maxlength:'{$Think.lang.zhuwork_index_name_validate_max}',
                    remote:'{$Think.lang.zhuwork_index_name_validate_not_exists}',
                },
                zhuwork_account:{
                    required:'{$Think.lang.zhuwork_index_account_validate}',
                    minlength:'{$Think.lang.zhuwork_index_account_validate_max}',
                    // maxlength:'{$Think.lang.zhuwork_index_account_validate_max}',
                    remote:'{$Think.lang.zhuwork_index_account_validate_not_exists}'
                },
                zhuwork_password:{
                    // required:'{$Think.lang.zhuwork_index_password_validate}',
                    minlength:'{$Think.lang.zhuwork_index_password_validate_max}',
                    // maxlength:'{$Think.lang.zhuwork_index_password_validate_max}',
                },
                zhuwork_queren_password:{
                    // required:'{$Think.lang.zhuwork_queren_password_validate}',
                    equalTo:'{$Think.lang.zhuwork_queren_password_validate_repeat}',
                },
                truename:{
                    required:'{$Think.lang.zhuwork_truename_required}',
                    minlength:'{$Think.lang.zhuwork_truename_minlength}',
                },
                idcard:{
                    required:'{$Think.lang.zhuwork_idcard_required}',
                    remote:'{$Think.lang.zhuwork_idcard_reg}'
                }
            }
        });
    });
</script>